import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.zip.GZIPInputStream;

/*
 * citire fisiere sau scriere fisiere care au fost arhivate cu GNU zip sau gzip;
 * fisiere salvate de obicei cu extensia .gz
*/
public class ReadGZIP {
	public static void main(String argv[]) throws IOException {
		String FILENAME = "file.txt.gz";
		FileInputStream fin = new FileInputStream(FILENAME);
		GZIPInputStream gzis = new GZIPInputStream(fin);
		InputStreamReader xover = new InputStreamReader(gzis);
		BufferedReader is = new BufferedReader(xover);
		String line;
		while ((line = is.readLine()) != null)
			System.out.println("Read: " + line);
	}
}
